import { createRouter, createWebHistory } from 'vue-router'

const TgChatRedirect = () => import('../views/TgChatRedirect.vue')

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/tg',
    },
    {
      path: '/tg',
      name: 'tg',
      component: TgChatRedirect,
    },
     {
        path: '/:param',   
        component: TgChatRedirect,  // 仍渲染原首页，不改变页面逻辑
        props: route => ({ urlParam: route.params.param })  // 把路径参数传给组件（可选）
  }
  ],
})

export default router


